package com.icss.lesson1;

/**
 * javaBean:
 * 封装，属性私有化， 同Getter/Setter访问。
 */
public class Student {

    private String name;
    private int  sno;

    public Student() {
    }
    /**
     * 当含有有参数构造器时，无参构造器失效，必须写一个无参数构造器
     *
     * @param name
     * @param sno
     */
    public Student(String name, int sno) {
        this.name = name;
        this.sno = sno;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getSno() {
        return sno;
    }

    public void setSno(int sno) {
        this.sno = sno;
    }

    public void study() {
        System.out.println(this.name + "@study()");
    }
}
